package com.jel.WiKikonwledge.bean;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.arangodb.springframework.annotation.Document;
import org.springframework.data.annotation.Id;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.Objects;

/**
 * @author curbert:jiangenlai
 * @description
 * @date 2022-05-24 18:21:41
 * @PACKAGE_NAME:com.jel.WiKikonwledge.bean
 */
@Document("wikidata")
@Repository
public class cont {
    String desc;//介绍
    ArrayList<Object> children;
    @Id
    String _key;
    JSONArray gene;
    JSONObject claims;
    String from;
    String to;
    String label;
    String type;
    JSONObject prop;
    int flown;

    public JSONArray getGene() {
        return gene;
    }

    public void setGene(JSONArray gene) {
        this.gene = gene;
    }

    public cont(String desc, ArrayList<Object> children, String _key, JSONArray gene, JSONObject claims, String from, String to, String label, String type, JSONObject prop, int flown) {
        super();
        this.desc = desc;
        this.children = children;
        this._key = _key;
        this.gene = gene;
        this.claims = claims;
        this.from = from;
        this.to = to;
        this.label = label;
        this.type = type;
        this.prop = prop;
        this.flown = flown;
    }

    public void setProp(JSONObject prop) {
        this.prop = prop;
    }

    public JSONObject getProp() {
        return prop;
    }

    public void setProp(String key,String value) {
        JSONObject prop = new JSONObject();
        prop.put(key, value);
        this.prop = prop;
    }

    @Override
    public String toString() {
        return "cont{" +
                "desc='" + desc + '\'' +
                ", children=" + children +
                ", _key='" + _key + '\'' +
                ", gene='" + gene + '\'' +
                ", claims=" + claims +
                ", from='" + from + '\'' +
                ", to='" + to + '\'' +
                ", label='" + label + '\'' +
                ", type='" + type + '\'' +
                ", flown=" + flown +
                '}';
    }


    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public cont(){
        super();
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public ArrayList<Object> getChildren() {
        return children;
    }

    public void setChildren(ArrayList<Object> children) {
        this.children = children;
    }

    public String get_key() {
        return _key;
    }

    public void set_key(String _key) {
        this._key = _key;
    }
    public JSONObject getClaims() {
        return claims;
    }

    public void setClaims(JSONObject claims) {
        this.claims = claims;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getFlown() {
        return flown;
    }

    public void setFlown(int flown) {
        this.flown = flown;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof cont)) {
            return false;
        }
        cont cont = (cont) o;
        return flown == cont.flown && Objects.equals(desc, cont.desc) && Objects.equals(children, cont.children) && Objects.equals(_key, cont._key) && Objects.equals(gene, cont.gene) && Objects.equals(claims, cont.claims) && Objects.equals(from, cont.from) && Objects.equals(to, cont.to) && Objects.equals(label, cont.label) && Objects.equals(type, cont.type) && Objects.equals(prop, cont.prop);
    }

    @Override
    public int hashCode() {
        return Objects.hash(desc, children, _key, gene, claims, from, to, label, type, prop, flown);
    }
}
